//
//  ByMineSettingAuthVC.m
//  mijifen_ios
//
//  Created by 朱凯 on 2017/10/23.
//  Copyright © 2017年 itboye. All rights reserved.
//

#import "ByMineSettingAuthVC.h"

// view
#import "ByViewMineUpdateAuthImage.h"       // 上传认证图片

@interface ByMineSettingAuthVC ()

@end

@implementation ByMineSettingAuthVC
{
    UITextField                 *_IDCodeTf;
    ByViewMineUpdateAuthImage   *_frontAuthView;
    ByViewMineUpdateAuthImage   *_backAuthView;
    UIButton                    *_commitButton;
}

#pragma mark - view method
- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"实名认证";
    self.view.backgroundColor = BY_BG_COLOR;
    [self addLeftBackBarButtonItem];
    
    [self createViews];
}

#pragma mark - 创建视图
- (void)createViews {
    
    // 手机号
    _IDCodeTf = [UITextField new];
    _IDCodeTf.font = FONT(16);
    _IDCodeTf.backgroundColor = [UIColor whiteColor];
    _IDCodeTf.layer.masksToBounds = true;
    _IDCodeTf.layer.cornerRadius = 4;
    _IDCodeTf.textAlignment = NSTextAlignmentCenter;
    _IDCodeTf.placeholder = @"请输入您的身份证号码";
    [self.view addSubview:_IDCodeTf];
    [_IDCodeTf mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(15);
        make.right.equalTo(self.view).offset(-15);
        make.top.equalTo(self.view).offset(10);
        make.height.equalTo(@50);
    }];
    
    // 提交按钮
    _commitButton = [UIButton buttonWithType:UIButtonTypeCustom];
    _commitButton.layer.masksToBounds = true;
    _commitButton.layer.cornerRadius = 4;
    _commitButton.backgroundColor = BY_THEME_COLOR;
    [_commitButton setTitle:@"提交" forState:UIControlStateNormal];
    [_commitButton setTitleColor:BY_GOLD_COLOR forState:UIControlStateNormal];
    [_commitButton addTarget:self action:@selector(commit) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:_commitButton];
    [_commitButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(_IDCodeTf);
        make.height.equalTo(@44);
        if (@available(ios 11.0,*)) {
            make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom).offset(-20);
        } else {
            make.bottom.equalTo(self.view).offset(-20);
        }
    }];
    
    // 正反认证图片
    _frontAuthView = [[ByViewMineUpdateAuthImage alloc] init];
    _frontAuthView.note = @"点击上传身份证正面";
    [self.view addSubview:_frontAuthView];
    [_frontAuthView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(_IDCodeTf);
        make.top.equalTo(_IDCodeTf.mas_bottom).offset(10);
    }];
    
    _backAuthView = [[ByViewMineUpdateAuthImage alloc] init];
    _backAuthView.note = @"点击上传身份证反面";
    [self.view addSubview:_backAuthView];
    [_backAuthView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(_frontAuthView);
        make.bottom.equalTo(_commitButton.mas_top).offset(-10);
        make.top.equalTo(_frontAuthView.mas_bottom).offset(15);
        make.height.equalTo(_frontAuthView);
    }];
}

#pragma mark - 点击事件
- (void)commit {
    
}

@end
